﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IronCow.UnitTests.Mock
{
    class MockTaskNoteResponsePart : MockResponsePart
    {
        private string mId;
        public DateTime Created { get; set; }
        public DateTime Modified { get; set; }
        public string Title { get; set; }
        public string Body { get; set; }

        public MockTaskNoteResponsePart(int id)
        {
            mId = id.ToString();
            Created = DateTime.Now;
            Modified = DateTime.Now;
        }

        public override void GetResponseMarkup(System.Xml.XmlWriter markupWriter, Dictionary<string, string> parameters)
        {
            markupWriter.WriteStartElement("note");
            markupWriter.WriteAttributeString("id", mId.ToString());
            markupWriter.WriteAttributeString("created", Created.ToString("s"));
            markupWriter.WriteAttributeString("modified", Modified.ToString("s"));
            markupWriter.WriteAttributeString("title", Title);
            markupWriter.WriteString(Body);
            markupWriter.WriteEndElement();
        }
    }
}
